#!/bin/bash

appname=Pically
ver=$1

ant

cd dist
mv *gz _archive
mv *zip _archive
mv *dmg _archive
dir=${appname}_$ver
mkdir $dir
mv ${appname}.jar $dir/

# windows version
cp ${appname}.bat $dir/
zip -r ${appname}_$ver.zip $dir
rm $dir/${appname}.bat

# linux version
cp ${appname}.sh $dir/
tar cf ${appname}_$ver.tar $dir
rm $dir/${appname}.sh
gzip ${appname}_$ver.tar

# mac os
cp -f $dir/${appname}.jar ${appname}.app/Contents/Resources/Java
hdiutil create ${appname}_$ver.dmg -volname "${appname}" -fs HFS+ -srcfolder ${appname}.app

rm -r $dir
